package category

import (
	"context"
	"github.com/gin-gonic/gin"
	"goods_bff/controller"
	"goods_bff/forms"
	"goods_bff/goods_proto"
	"goods_bff/pkg"
	"net/http"
)

func DeleteCategory(c *gin.Context) {

	//接收参数
	var form forms.DeleteCategoryForm
	if err := c.ShouldBind(&form); err != nil {
		controller.ReturnErrorJson(err, c)
		return
	}
	comment := pkg.Comment()
	comment.DeleteCategory(context.Background(), &goods_proto.DeleteCategoryRequest{
		Id: int32(form.ID),
	})

	c.JSON(http.StatusOK, gin.H{
		"code": 0,
		"msg":  "success",
		"data": nil,
	})
}
